import axios from 'axios'
const http=axios.create({
    baseURL: 'https://jsonplaceholder.typicode.com',
    timeout: 1000,
    headers: {'X-Custom-Header':'foobar'}
});

//响应拦截器
http.interceptors.response.use(function(response){
    return response.data;
}, function(error){
    console.log("响应错误",error); 
    return Promise.reject(error);
})
export default http;